//
// Created by PC on 2024/5/10.
//


#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n = 100;
    n = 1e6;
    bool isP[n+1]={0};
    for(int i = 2;i<=n;++i)
        isP[i]=1;
    vector<int> primes;
    for (int i = 2; i < n+1; ++i)
    {
        if(isP[i])
            primes.push_back(i);
        for (int j = 0; j < primes.size() && primes[j]*i<=n; ++j)
        {
            isP[primes[j]*i]=0;
            if(i%primes[j]==0)
                break;
        }
    }
    cout<<primes.size();
    return 0;
}